<template>
	<div id="help-types">
		<sub-page-header title="帮助中心"></sub-page-header>
		<ul class="help-list">
			<li v-for="(item, key) in types" class="clearfix" key="key">
				<router-link :to="'/help/'+key+'/'+item.chinese" tag="div">
					<div class="pull-left">
						{{item.chinese}}
					</div>
					<div class="pull-right">
						<i class="iconfont icon-right"></i>
					</div>
				</router-link>
			</li>
		</ul>
		<div class="bottom-margin"></div>
	</div>
</template>

<script>
import SubPageHeader from '~/components/SubPageHeader.vue';
import api from '~/api/api.js';

export default {
	components: {
		SubPageHeader
	},
	data () {
		return {
			types: []
		}
	},
	mounted () {
		var vue = this;
		api.get('/help/index')
		.then(function (response) {
			vue.types = response.data;
		})
		.catch(function (error) {
			vue.$message('加载失败');
		});
	}
}
</script>

<style scoped>
.help-list li {
	padding: 12px;
	border-bottom: 1px solid #eaeaea;
}
</style>